Typical graphical user interfaces are designed for display devices of standard resolutions. Until recently a “high resolution” display device typically had a large number of pixels on a large display area, when compared to a standard resolution display device. Thus, most display devices have similar numbers of pixels in a given size of a display area. However, recent developments in display devices, especially in high resolution LCD display panels, allow significantly more pixels to be displayed on an area of a fixed size. The pixel size of a high resolution display device is typically smaller than the pixel size of a low resolution display device. Thus, graphical user interfaces may appear too small to be interacted with when displayed on a high resolution display device without any modification. To enable legacy (existing) applications to run graphical user interfaces on high resolution displays, it is often desirable to scale the user interface components by an arbitrary non-integer factor.
FIGS. 2-3 show a scenario of displaying an image for a low resolution device on a high resolution device. Area 205 in FIG. 2 and area 305 in FIG. 3 have the same size. Block 201 in FIG. 2 represents the size of a pixel on the low resolution display device. Pixel image 203 shows a graphical user interface component displayed on the low resolution display device. Block 301 in FIG. 3 represents the size of a pixel on the high resolution display device. Pixel image 303 shows the same graphical user interface component displayed on the high resolution display device. The dimensions of pixel 301 of the high resolution display device are much smaller than the dimensions of pixel 201 of the low resolution display device. Thus, the high resolution device can display more pixels on the same area than the low resolution device. The pixel image designed for the low resolution device appears much smaller when displayed on the high resolution devices (e.g., pixel image 303 in FIG. 3 appears much smaller than pixel image 203 in FIG. 2). Graphical user interface components are typically designed in the unit of pixels. Thus, when the GUI components designed for a low resolution device is displayed on a high resolution device, the GUI components may appear too small to be comfortable for a user. It is often desirable to scale up the GUI components so that a user can comfortably interactive with the GUI components displayed on the high resolution display device.
When a window is scaled up by an arbitrary non-integer factor (e.g., 4/3≈1.3333), the boundaries of the components of the window may not align with the lines of pixels. The coordinates for the boundaries of the scaled up components may be real numbers instead of integer numbers (e.g., an original component of 100 pixels long may be scaled to 133.33 pixels long). Application developers typically lay out the original view hierarchy to align the boundaries of the components to the pixel lines in order to enable a number of optimizations, such as independent redrawing of views. If a scaled component of a view hierarchy is no longer aligned to pixel lines, drawing glitches can appear on view boundaries.